#ifndef __statefactory_h_
#define __statefactory_h_

#include <map>
#include "pugixml.hpp"
#include "state.h"
class TransitionTarget;

class StateFactory
{
 public:
  StateFactory()
    {
	typeMap["parallel"]=TransitionTarget::Parallel;
	typeMap["history"]=TransitionTarget::History;
	typeMap["state"]=TransitionTarget::Atomic;
	typeMap["final"]=TransitionTarget::Final;
    };
  virtual ~StateFactory()
    {};

  TransitionTarget *buildState(pugi::xml_node &node, TransitionTarget *parent=NULL);
  //StatePtr buildState(pugi::xml_node &node, StatePtr const & parent);
  Transition *buildTransition(std::string sid, std::string tid="", 
			      std::string event="", std::string cond="");
private:
  map<std::string, TransitionTarget::TtType> typeMap;
};
#endif
